package service.impl.graph;

import java.util.List;

import model.GraphResult;
import model.GraphSearchCriteria;
import service.impl.Converter;

public class HourCounter {

	public static String getLearningTimeCount(List<GraphResult> graphResults, GraphSearchCriteria criteria) {
		Double spentTimeSum = 0.0;
		for (GraphResult graphResult : graphResults) {
			spentTimeSum += graphResult.getStudyPeriod();
		}
		return Converter.formatDouble(spentTimeSum, 1).toString() + " h";
	}

}
